﻿#define TCP
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;

using System.Net;
//using System.Net.Sockets;

using Tensop.Net.Tcp;

namespace Tensop.Test
{

    interface Catcher
    {
        byte Protocol { get; set; }//如果是这个协议则使用该捕获器处理
        void Parse(byte[] data);
        event Action<byte[]> Catch;
    }


    class Program
    {
        static void Main(string[] args)
        {
            Dictionary<int, int> map = new Dictionary<int, int>();
            map.Add( 1, 3 );
            var i =map[3];
            Console.ReadLine();
        }

    }
}



//            while (true)
//            { }
//            Socket client = new Socket( AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp );
//            Socket server = new Socket( AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp );
//#if HTTP
//            var ip = Dns.GetHostAddresses("porn68jav.com");
//            foreach (IPAddress i in ip)
//                Console.WriteLine(i.ToString());

//            try
//            {
//                client.Connect(new IPEndPoint(ip[1], 80));
//                Console.WriteLine("连接成功");
//                var s = Encoding.ASCII.GetBytes(@"GET http://porn68jav.com/ HTTP/1.1
//Host: porn68jav.com
//Connection: keep - alive
//Upgrade - Insecure - Requests: 1
//User - Agent: Mozilla / 5.0(Windows NT 6.1;
//                WOW64) AppleWebKit / 537.36(KHTML, like Gecko) Chrome / 54.0.2840.59 Safari / 537.36 115Browser / 8.1.0
//Accept:
//                text / html,application / xhtml + xml,application / xml;
//                q = 0.9,image / webp,*/*;q=0.8
//Accept-Encoding: gzip, deflate, sdch
//Accept-Language: zh-CN,zh;q=0.8

//");
//               /* Cookie:
//                __cfduid = df91c5a3cecc28486e7aa37de3b20c9811493091996;
//                HstCfa3775543 = 1493092001383;
//                HstCmu3775543 = 1493092001383;
//                HstCla3775543 = 1493579822216;
//                HstPn3775543 = 1;
//                HstPt3775543 = 46;
//                HstCnv3775543 = 8;
//                HstCns3775543 = 23;
//                __atuvc = 33 % 7C17 % 2C9 % 7C18;
//                cf_clearance = 9fef3f76b48f28875d2d5e5d51fd87791edd234d - 1493711720 - 1800*/

//                client.Send(s);
//                var b = new byte[65536];
//                var length = client.Receive(b);
//                Console.WriteLine($"返回长度:\x20{length}");
//                Console.WriteLine(Encoding.UTF8.GetString(b, 0, length));
//                Regex.Match(@"Content-Length:[\d]+",);

//                client.Receive()
//            }
//            catch(SocketException e)
//            {
//                Console.WriteLine(e.Message);
//            }
//#endif
//#if CLASS
//            Test[] t = new Test[ 16 ];
//            for (int i = 0; i < 2; i++)
//            {
//                t[ i ] = new Test();
//            }
//#endif

//#if Socket
//            client.Connect(new IPEndPoint(IPAddress.Parse("192.168.31.236"),40000));          
//            Console.WriteLine("Client Connected!");
//            Console.ReadLine();
//            Console.WriteLine(client.Poll(3000, SelectMode.SelectRead));
//#endif